from marshmallow import Schema, fields

class UserSchema(Schema):
    id = fields.Int(dump_only=True)  # 只用于序列化输出
    username = fields.Str(required=True)
    email = fields.Email(required=True)
    password = fields.Str(required=True, load_only=True)  # 只用于反序列化输入
    created_at = fields.DateTime(dump_only=True)
    updated_at = fields.DateTime(dump_only=True)
